using System;
using System.Data;
using System.Collections.Generic;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;

using System.Xml.Serialization;

namespace AIFSCMSService
{
    using AIFSContentManagementSystem;
    
    using AIFSContentManagementSystem.DomainObjects;

    using AIFSContentManagementSystem.ArticleManagement;
    using AIFSContentManagementSystem.ArticleManagement.Messages;

    using AIFSContentManagementSystem.Exceptions;

    /// <summary>
    /// Summary description for Service1
    /// </summary>
    [WebService(Namespace = "http://www.aifs.org/AIFSCMSService/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [ToolboxItem(false)]
    public class AIFSCMSServiceProvider : System.Web.Services.WebService
    {

        [WebMethod]
        [XmlInclude(typeof(GetArticleListRequest))]
        [XmlInclude(typeof(ArticleType))]
        [XmlInclude(typeof(Criteria))]
        [XmlInclude(typeof(GetArticleListResponse))]
        public AIFSCMSResponse GetArticleList(GetArticleListRequest request)
        {
            try
            {
                AIFSCMSFacade facade = new AIFSCMSFacade();
                AIFSCMSResponse getArticleListRes = facade.Process(request);
                return getArticleListRes;
            }
            catch (AIFSContentManagementSystemException aex)
            {
                throw aex;
            }
            catch (Exception ex)
            {
                throw new AIFSContentManagementSystemException("Unhandled exception", ex);
            }
        }
    }
}
